package com.szq.yygh.hosp.controller;

import com.szq.yygh.common.result.Result;
import com.szq.yygh.hosp.model.hosp.Schedule;
import com.szq.yygh.hosp.service.ScheduleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/***
 * All rights Reserved, Designed By www.jx-lab.com
 * @Title: ScheduleController
 * @Description:
 * @author lixy
 * @date 2021/8/20 17:15
 * @version V1.0
 * @Copyright: www.jx-lab.com Inc. All rights reserved.
 * 注意：本内容仅限于众合景轩信息技术有限公司内部传阅，禁止外泄以及用于其他的商业目
 */
@Api(tags = "排班管理")
@RestController
@RequestMapping("/admin/hosp/schedule")
public class ScheduleController {

    @Autowired
    private ScheduleService scheduleService;

    @ApiOperation("查询排班规则数据")
    @GetMapping("/getScheduleRule/{page}/{limit}/{hoscode}/{depcode}")
    public Result getScheduleRule(@PathVariable Integer page, @PathVariable Integer limit,
                                  @PathVariable String hoscode, @PathVariable String depcode){
        Map<String, Object> result = scheduleService.getScheduleRule(page, limit, hoscode, depcode);
        return Result.ok(result);
    }

    @ApiOperation("查询排班详细信息")
    @GetMapping("/getScheduleDetail/{hoscode}/{depcode}/{workDate}")
    public Result getScheduleDetail(@PathVariable String hoscode, @PathVariable String depcode,
                                    @PathVariable String workDate){
        List<Schedule> result = scheduleService.getScheduleDetail(hoscode, depcode, workDate);
        return Result.ok(result);
    }
}
